import 'package:flutter/material.dart';
import 'package:xindong/common/xindong_sezhi.dart';

// 添加图片组件
//
// radius 圆角
// onTap 点击事件
class XinDongImageAddWidget extends StatelessWidget {
  final double? radius;
  final Widget? child;
  final Function()? onTap;

  const XinDongImageAddWidget({Key? key, this.radius, required this.onTap, this.child}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      behavior: HitTestBehavior.opaque,
      child: PhysicalModel(
        color: DZColors.coverColor,
        borderRadius: BorderRadius.circular(radius ?? 0.0),
        clipBehavior: Clip.antiAlias,
        child: child ?? const Icon(Icons.add, color: Colors.grey, size: 30),
      ),
    );
  }
}
